//
//  HZJSingerLIstTVCell.m
//  HZ_Beautiful_Music
//
//  Created by dllo on 16/4/6.
//  Copyright © 2016年 ui. All rights reserved.
//

#import "HZJSingerLIstTVCell.h"
#import "UIImageView+WebCache.h"
@interface HZJSingerLIstTVCell ()

@property (nonatomic, strong) UIImageView *image;
@property (nonatomic, strong) UILabel *name;
@property (nonatomic, strong) UILabel *lable;

@end

@implementation HZJSingerLIstTVCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
//        self.backgroundColor = [UIColor clearColor];
        NSLog(@"dsadafa%@", self.backgroundColor);
        self.image = [[UIImageView alloc] init];
        [self.contentView addSubview:_image];
        
        self.name = [[UILabel alloc] init];
        [self.contentView addSubview:_name];
        
        self.lable = [[UILabel alloc] init];
        [self.contentView addSubview:_lable];
        
        
        
    }
    return self;
}

- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    _image.frame = CGRectMake(15, 10, self.bounds.size.height - 20, self.bounds.size.height - 20);
    
    _name.frame = CGRectMake(_image.bounds.size.width + 25, self.bounds.size.height / 2 - 10, 50, 20);
    [_name sizeToFit];
    
    _lable.frame = CGRectMake(self.bounds.size.width - 20, _name.frame.origin.y, 10, 10);
    _lable.text = @">";
    
    [self.image.layer setCornerRadius:_image.bounds.size.width / 2];
    self.image.layer.masksToBounds = YES;
}

- (void)setListModel:(HZJSingerListModel *)listModel {
    
    _listModel = listModel;
    
    [_image sd_setImageWithURL:[NSURL URLWithString:listModel.pic_url]];
    _name.text = listModel.singer_name;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
